import { ajax } from '../helper/helper'

export const doAjaxPost = function(options) {

    //const type = options.type;
    const url =  options.url;
    const datas = {
        url,
        data : options.data
    };

    ajax({
        url: '/fetch/ajax',
        type: 'POST',
        data: datas,
        dataType: 'json',
        success: (data) => {
            options.success(data);
        },
        error: (data) => {
            options.error(data);
        }
    });
}